package com.adopapa.ethexplorer.domain;

import java.time.Instant;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "CONTRACT_INFO")
public class ContractInfo extends BaseUuidEntity {

	private static final long serialVersionUID = -5459834697938766071L;

	@Column(name = "contract_name")
	private String contractName;
	@Lob
	@Column(name = "abi_content")
	private String abi;
	@Lob
	@Column(name = "binary_content")
	private String binary;
	@Column(name = "contract_address")
	private String address;
	@Column(name = "tx_hash")
	private String txHash;
	@Column(name = "valid")
	private Boolean valid;
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone = "GMT+8")
	@Column(name = "create_time")
	private Instant createTime;

	public String getContractName() {
		return contractName;
	}

	public void setContractName(String contractName) {
		this.contractName = contractName;
	}

	public ContractInfo contractName(String contractName) {
		this.contractName = contractName;
		return this;
	}

	public String getAbi() {
		return abi;
	}

	public void setAbi(String abi) {
		this.abi = abi;
	}

	public ContractInfo abi(String abi) {
		this.abi = abi;
		return this;
	}

	public String getBinary() {
		return binary;
	}

	public void setBinary(String binary) {
		this.binary = binary;
	}

	public ContractInfo binary(String binary) {
		this.binary = binary;
		return this;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public ContractInfo address(String address) {
		this.address = address;
		return this;
	}

	public String getTxHash() {
		return txHash;
	}

	public void setTxHash(String txHash) {
		this.txHash = txHash;
	}

	public ContractInfo txHash(String txHash) {
		this.txHash = txHash;
		return this;
	}

	public Boolean getValid() {
		return valid;
	}

	public void setValid(Boolean valid) {
		this.valid = valid;
	}

	public ContractInfo valid(Boolean valid) {
		this.valid = valid;
		return this;
	}

	public Instant getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Instant createTime) {
		this.createTime = createTime;
	}

	public ContractInfo createTime(Instant createTime) {
		this.createTime = createTime;
		return this;
	}

}
